namespace java.swift net.gdface.sdk.decorator
namespace cpp gdface
namespace java net.gdface.sdk.thrift.client
namespace py gdface.thrift



struct FAngle {
  1: required double confidence;
  2: required i32 pitch;
  3: required i32 roll;
  4: required i32 yaw;
}

struct EyeInfo {
  1: required i32 leftx;
  2: required i32 lefty;
  3: required i32 rightx;
  4: required i32 righty;
}

struct FInt2 {
  1: required i32 x;
  2: required i32 y;
}

struct FRect {
  1: required i32 height;
  2: required i32 left;
  3: required i32 top;
  4: required i32 width;
}

exception ImageErrorException {
  1: optional string message;
  2: optional string causeClass;
  3: optional string serviceStackTraceMessage;
  4: optional string causeFields;
}

exception NotFaceDetectedException {
  1: optional string message;
  2: optional string causeClass;
  3: optional string serviceStackTraceMessage;
  4: optional string causeFields;
  5: required i32 codeNum;
  6: required i32 faceNum;
}

exception ServiceRuntimeException {
  1: optional string message;
  2: optional string causeClass;
  3: optional string serviceStackTraceMessage;
  4: optional string causeFields;
  5: required i32 type;
}

struct CodeInfo {
  1: optional FAngle angle;
  2: optional binary code;
  3: optional EyeInfo ei;
  4: optional binary facialData;
  5: optional FInt2 mouth;
  6: optional FInt2 nose;
  7: optional FRect pos;
}

service FaceApi {
  double compare2Face(1: optional binary imgData1, 2: optional CodeInfo facePos1, 3: optional binary imgData2, 4: optional CodeInfo facePos2) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  double compareCode(1: optional binary code1, 2: optional binary code2) throws (1: ServiceRuntimeException ex1);
  list<double> compareCodes(1: optional binary code1, 2: optional list<CodeInfo> codes) throws (1: ServiceRuntimeException ex1);
  map<CodeInfo, double> compareFaces(1: optional binary code, 2: optional binary imgData, 3: required i32 faceNum) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  list<double> compareFeatures(1: optional binary code1, 2: optional list<binary> codes) throws (1: ServiceRuntimeException ex1);
  double detectAndCompare2Face(1: optional binary imgData1, 2: optional FRect detectRect1, 3: optional binary imgData2, 4: optional FRect detectRect2) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  list<CodeInfo> detectAndGetCodeInfo(1: optional binary imgData, 2: required i32 faceNum) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  CodeInfo detectCenterFace(1: optional binary imgData) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  list<CodeInfo> detectFace(1: optional binary imgData) throws (1: ImageErrorException ex1, 2: ServiceRuntimeException ex2);
  list<CodeInfo> getCodeInfo(1: optional binary imgData, 2: required i32 faceNum, 3: optional list<CodeInfo> facePos) throws (1: NotFaceDetectedException ex1, 2: ServiceRuntimeException ex2);
  CodeInfo getCodeInfoSingle(1: optional binary imgData, 2: optional CodeInfo facePos) throws (1: ServiceRuntimeException ex1);
  binary getFeature(1: optional map<binary, CodeInfo> faces) throws (1: NotFaceDetectedException ex1, 2: ServiceRuntimeException ex2);
  bool hasFace(1: optional binary imgData) throws (1: ImageErrorException ex1, 2: ServiceRuntimeException ex2);
  bool isLocal() throws (1: ServiceRuntimeException ex1);
  bool multiFaceFeature() throws (1: ServiceRuntimeException ex1);
}
